Move lgdt_finish inline
authorIan.Campbell@xensource.com <Ian.Campbell@xensource.com>
Wed, 22 Feb 2006 15:17:04 +0000 (15:17 +0000)
committerIan.Campbell@xensource.com <Ian.Campbell@xensource.com>
Wed, 22 Feb 2006 15:17:04 +0000 (15:17 +0000)
Signed-off-by: Ian Campbell <Ian.Campbell@XenSource.com>
linux-2.6-xen-sparse/arch/i386/kernel/cpu/common-xen.c
linux-2.6-xen-sparse/arch/i386/kernel/head-xen.S
linux-2.6-xen-sparse/include/asm-i386/mach-xen/asm/hypervisor.h

index 1065f4160ae0c35c6976bf148e6ece0a40307478..d33ecbceca249038f1b7b5e8cb62b06de235da3f 100644 (file)
@@ -583,7 +583,19 @@ void __cpuinit cpu_gdt_init(struct Xgt_desc_struct *gdt_descr)
        }
        if (HYPERVISOR_set_gdt(frames, gdt_descr->size / 8))
                BUG();
-       lgdt_finish();
+
+       /* Reload all the segment registers after changing gdt. */
+       asm volatile("movl %0,%%ss\n\t"
+                    "movl %1,%%ds\n\t"
+                    "movl %1,%%es\n\t"
+                    "pushl %2\n\t"             /* Reload CS by intersegment return. */
+                    "pushl $1f\n\t"
+                    "lret\n\t"
+                    "1:\n\t"
+                    : /* no outputs */
+                    : "r"(__KERNEL_DS),
+                      "r"(__USER_DS),
+                      "r"(__KERNEL_CS));
 }
 
 /*
index 6d0e732edbd31b7ca2832186d0109c53ccdcd82f..61db92a16d85d4154656d6f8aa0e13c45a8c0c3a 100644 (file)
@@ -77,19 +77,6 @@ L6:
        jmp L6                  # main should never return here, but
                                # just in case, we know what happens.
 
-ENTRY(lgdt_finish)
-       movl $(__KERNEL_DS),%eax        # reload all the segment registers
-       movw %ax,%ss                    # after changing gdt.
-
-       movl $(__USER_DS),%eax          # DS/ES contains default USER segment
-       movw %ax,%ds
-       movw %ax,%es
-
-       popl %eax                       # reload CS by intersegment return
-       pushl $(__KERNEL_CS)
-       pushl %eax
-       lret
-
        ALIGN
 
 # boot GDT descriptor (later on used by CPU#0):
index c72cafeb52ed36f1b335946450d16b8bb56144ed..3ad6799f13a7981077bde2f562b412291390e96d 100644 (file)
@@ -61,9 +61,6 @@ void xen_cpu_idle (void);
 /* arch/xen/i386/kernel/hypervisor.c */
 void do_hypervisor_callback(struct pt_regs *regs);
 
-/* arch/xen/i386/kernel/head.S */
-void lgdt_finish(void);
-
 /* arch/xen/i386/mm/hypervisor.c */
 /*
  * NB. ptr values should be PHYSICAL, not MACHINE. 'vals' should be already